//
//  SPic4TableViewCell.m
//  News
//
//  Created by dlios on 15-5-15.
//  Copyright (c) 2015年 PEAK. All rights reserved.
//

#import "SPic4TableViewCell.h"

@implementation SPic4TableViewCell

- (void)dealloc
{
    [_img1 release];
    [_img2 release];
    [_img3 release];
    [_img4 release];
    [_lable1 release];
    [_lable release];
    [super dealloc];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier

{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.img1 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"page_bg_35"]];
        [self.contentView addSubview:_img1];
        [_img1 release];
        
        self.img2 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"yinji"]];
        [self.contentView addSubview: _img2];
        [_img2 release];
        
        self.img3  = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"page_bg_35"]];
        [self.contentView addSubview:_img3];
        [_img3 release];
        
        self.img4 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"iconfont-tupian"]];
        [self.contentView addSubview:_img4];
        [_img4 release];
        
        self.lable  = [[UILabel alloc] init];
//        _lable.backgroundColor = [UIColor redColor];
        [self.contentView addSubview: _lable];
        [_lable release];
        self.lable1 = [[UILabel alloc] init];
        [self.contentView addSubview:_lable1];
        [_lable1 release];
        
    }
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    
    _img1.frame = CGRectMake(10, 10, [UIScreen mainScreen].bounds.size.width/ 3.3, [UIScreen mainScreen].bounds.size.height / 6.67);
    _img2.frame = CGRectMake(10, self.img1.frame.size.height + 15, self.contentView.frame.size.width/ 3.3, [UIScreen mainScreen].bounds.size.height / 6.67);
    
    _img3.frame = CGRectMake(self.contentView.frame.size.width/ 2.9 ,10, [UIScreen mainScreen].bounds.size.width / 1.6, [UIScreen mainScreen].bounds.size.height / 3.25);
    
    _lable.frame = CGRectMake(10, [UIScreen mainScreen].bounds.size.height / 2.8, [UIScreen mainScreen].bounds.size.width , 20);
    
    _lable1.frame = CGRectMake(40, [UIScreen mainScreen].bounds.size.height / 2.57, 20, 20);
    
    _img4.frame = CGRectMake(10,[UIScreen mainScreen].bounds.size.height / 2.57, 20, 20);
    
}
-(void)setPic:(SPic *)pic
{
    if (_pic != pic) {
        [_pic release];
        _pic = [_pic retain];
    }
    _lable.text  =pic.setname;
    _lable1.text = pic.imgsum;
    [_img1 sd_setImageWithURL:[NSURL URLWithString:pic.pics[0]]placeholderImage:[UIImage imageNamed:@"``_3(NZ4U{L@4L7FN0J70DA"]];
    [_img2 sd_setImageWithURL:[NSURL URLWithString:pic.pics[1]]placeholderImage:[UIImage imageNamed:@"``_3(NZ4U{L@4L7FN0J70DA"]];
    [_img3 sd_setImageWithURL:[NSURL URLWithString:pic.pics[2]]placeholderImage:[UIImage imageNamed:@"``_3(NZ4U{L@4L7FN0J70DA"]];
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
